package org.pearl.validation.demo.mapstruct;

import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

/**
 * projectName: demoBox
 *
 * @author: caicai
 * time: 2024/1/12 17:48 周五
 * description:
 */
@Mapper
public interface  PersonAddressMapper {
    PersonAddressMapper INSTANCE = Mappers.getMapper(PersonAddressMapper.class);

    @Mapping(source = "person.name", target = "personName")
    @Mapping(source = "address.houseNo", target = "houseNumber")
    DeliveryAddressDto personAndAddressToDeliveryAddressDto(Person person, Address address);

}
